The present invention is in the field of flash memory. More particularly, the present invention provides a method, apparatus, and system to enhance an interface of a flash memory device.
Flash memory devices must be fast, low power, and physically compact data storage to remain competitive. The physical configuration and command structure of the memory affect the memory access speed. Memory access speed is based on the speed of manipulating data in flash memory that, on a fundamental level, requires programming, erasing, and reading the data. Algorithms typically referred to as flash primitives handle these fundamental procedures. Programming adds a charge to the memory cell, erasing removes a charge from the memory cell, and reading determines the charge stored in the memory cell. For a procedure to be performed on a memory cell, the memory cell""s address must be latched. Latching is a method of selecting and holding the address of the memory cell to be programmed, erased, or read and requires application of certain voltages.
The flash memory devices typically incorporate basic command code and flash primitives code to latch and program, erase, or read a memory cell. Basic commands are routines that coordinate the use of flash primitives to manipulate data at a higher level. For example, the basic command for a read can receive an address, latch each transistor storing data for a byte beginning at that address, and initiate the flash primitives code for reading each transistor. The flash primitives reading algorithm may simply determine the contents of whatever memory cell is latched and indicate that the algorithm has completed the operation by returning a status. The basic command code can make the byte available at a data input/output and return a status indicating that the data from the address is available at that data input/output.
Commands performed on flash memory devices are commonly more complex than the basic commands. These complex commands typically involve more than one basic command or a repetition of a basic command. Complex commands focus on manipulating data rather than on how to make the flash memory device perform the data manipulation. For example, a software application such as a word processor may store a temporary copy of a file while that file is being edited. Periodically, the software application may also update the original file with changes to the temporary copy. It is not efficient for each software application to have a driver to manipulate each type of data storage device so the software application may instruct a media management system to store the data. The media management system can have a driver for each attached data storage device. Thus, the software application can instruct the media management system to make a copy of the file in a specific directory, causing the media management system to instruct the flash memory device to perform the reading, programming, and erasing to copy the data and then the reading, erasing, and programming that may be necessary to update the file.
Complex command benefits can be enhanced with some data structures such as a header data structure. The contents of a flash memory device can be organized in directories and files by creating headers. Headers can comprise references to subdirectories, parent directories, and/or address ranges that represent a single file. For example, files in a directory can be written to several address ranges depending upon where memory is available. The files can be located by reading the header. A complex command such as delete parameter, for instance, can be given a reference to a file within a directory and subdirectory. The delete parameter command can use the basic command read to find the directory, subdirectory, and file. Then, programming or erasing a bit representing validity or invalidity of the file can invalidate the data in the entire file. Invalidating the file effectively deletes the file but saves the cycles that would be required to erase the entire file. Regardless of the size of the file, the delete parameter procedure can complete the deletion in the time required to read the file header and program or erase a bit.
Unlike some complex commands, basic commands do not implement power loss and procedure interruption recovery measures. For example, when copying data, programming can be split up into units of memory cells, such as blocks or partial blocks. A memory register can store an indication such as how many of these units have been programmed and which unit is being programmed. If power is lost, a power loss recovery operation can read the memory register, discard the unit of data that was being programmed when power was interrupted, and resume programming at the discarded unit. The procedure interruption recovery operation may also read the memory register to determine where an operation was interrupted. Procedure interruption recovery may increase memory access speed by allowing interruption of long operations such as erasing to service short operations such as reading.
Several limitations are involved with issuing complex commands from a media management system. First, designing interfaces for each memory device detracts from development of other features and can limit the size of a product. Second, the time required to execute a complex command may be dependent upon the speed of the interface between the flash memory device and the media management system and the amount of data to be manipulated. For example, a find command may locate data in an address range. The media management system may transmit read commands for each byte in the address range. The basic command of reading within the flash memory device can then transmit the data at each address to the media management system and the media management system can compare the data to the data to be found. Once the search is complete, the media management system can return a result. Every address can require at least two transmissions, one to and one from the flash memory device. Third, the bus between the flash memory device and the media management system is busy during each read and write. Fourth, the media management system is busy during each transmission and comparison. Fifth, memory available to the media management system is allocated for complex command code. Finally, the bus from the memory containing complex command code to the media management system is busy while executing the code.